<?php
$moduleName = Zend_Controller_Front::getInstance()->getRequest()->getModuleName();
$controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
$departmentNameMapping = array();
$departmentNameMapping['planning'] = 'Projectering';
$departmentNameMapping['marketing'] = 'Forsaljning';
$departmentNameMapping['streetDigging'] = 'Tomter';
$departmentNameMapping['houseDigging'] = 'Schakt';
$departmentNameMapping['installation'] = 'Installation';
$departmentNameMapping['economy'] = 'Ekonomi';

$moduleNameMapping = array();
$moduleNameMapping['planning'] = '/planning/cabinet';
$moduleNameMapping['marketing'] = '/marketing/mynotification';
$moduleNameMapping['streetDigging'] = '/street/mynotification';
$moduleNameMapping['houseDigging'] = '/house/mynotification';
$moduleNameMapping['installation'] = '/installation/mynotification';
$moduleNameMapping['economy'] = '/economy';
?>
<div id="nav">
    <ul>
        <?php if ($this->userDetail->role == 'superadmin') {
 ?>
            <li> <a class="<?= ($moduleName == 'home') ? 'mainNavSelected' : ''; ?>" href="/home/dashboard"><span>Home</span></a></li>
            <li> <a class="<?= ($moduleName == 'planning') ? 'mainNavSelected' : ''; ?>" href="/planning/cabinet"><span>Projectering</span></a></li>
            <li> <a class="<?= ($moduleName == 'marketing') ? 'mainNavSelected' : ''; ?>" href="/marketing/notification"><span>Forsaljning</span></a></li>
            <li> <a class="<?= ($moduleName == 'street') ? 'mainNavSelected' : ''; ?>" href="/street/notification"><span>Tomter</span></a></li>
            <li> <a class="<?= ($moduleName == 'house') ? 'mainNavSelected' : ''; ?>" href="/house/notification"><span>Schakt</span></a></li>
            <li> <a class="<?= ($moduleName == 'installation') ? 'mainNavSelected' : ''; ?>" href="/installation/notification"><span>Installation</span></a></li>
            <li> <a class="mainNavLast <?= ($moduleName == 'economy') ? 'mainNavSelected' : ''; ?>" href="/economy"><span>Ekonomi</span></a></li>
        <?php
        }else if ($this->userDetail->role == 'admin') {
 ?>          
            <?php if($this->userDetail->department == 'planning'){?><li> <a class="<?= ($moduleName == 'planning') ? 'mainNavSelected' : ''; ?>" href="/planning/cabinet"><span>Projectering</span></a></li>
            <?php }else if($this->userDetail->department == 'marketing'){?><li> <a class="<?= ($moduleName == 'marketing') ? 'mainNavSelected' : ''; ?>" href="/marketing/notification"><span>Forsaljning</span></a></li>
            <?php }else if($this->userDetail->department == 'streetDigging'){?><li> <a class="<?= ($moduleName == 'street') ? 'mainNavSelected' : ''; ?>" href="/street/notification"><span>Tomter</span></a></li>
            <?php }else if($this->userDetail->department == 'houseDigging'){?><li> <a class="<?= ($moduleName == 'house') ? 'mainNavSelected' : ''; ?>" href="/house/notification"><span>Schakt</span></a></li>
            <?php }else if($this->userDetail->department == 'installation'){?><li> <a class="<?= ($moduleName == 'installation') ? 'mainNavSelected' : ''; ?>" href="/installation/notification"><span>Installation</span></a></li>
            <?php }else if($this->userDetail->department == 'economy'){?><li> <a class="mainNavLast <?= ($moduleName == 'economy') ? 'mainNavSelected' : ''; ?>" href="/economy"><span>Ekonomi</span></a></li><?php }?>
        
        <?php
        } else {
        ?>
            <li> <a class="mainNavSelected" href="<?php echo $moduleNameMapping[$this->userDetail->department] ?>"><span><?php echo $departmentNameMapping[$this->userDetail->department] ?></span></a></li>
<? } ?>
    </ul>
</div>